#ifndef _MAILRECIPIENT_HPP_
#define _MAILRECIPIENT_HPP_

#include "jhdefs.hpp"
#include <string>

NET_NAMESPACE_BEGIN

class CMailRecipient
{
public:
	enum RecipientType
	{
		PRIMARY_RECIPIENT,
		CC_RECIPIENT,
		BCC_RECIPIENT
	};

	CMailRecipient();
	CMailRecipient(const CMailRecipient& recipient);
	CMailRecipient(RecipientType type, const std::string& address);
	CMailRecipient(RecipientType type, const std::string& address, const std::string& realName);
	~CMailRecipient();
	CMailRecipient& operator = (const CMailRecipient& recipient);

	void swap(CMailRecipient& recipient);

	RecipientType getType() const;
	void setType(RecipientType type);

	const std::string& getAddress() const;
	void setAddress(const std::string& address);

	const std::string& getRealName() const;
	void setRealName(const std::string& realName);

private:
	std::string   m_address;
	std::string   m_realName;
	RecipientType m_type;
};

inline void swap(CMailRecipient& r1, CMailRecipient& r2)
{
	r1.swap(r2);
}

NET_NAMESPACE_END

#endif
